package com.qf.work20250111;

/**
 * @author zdl
 * @date 2025/1/11
 */
public class Demo1 {
    //反射
    public static void main(String[] args) throws ClassNotFoundException {
        //获取Class对象
        //方法1  Class.forName();
        Class<?> aClass = Class.forName("com.qf.work20250111.Person");
        System.out.println(aClass);
        //方法2  类.class
        Class<Person> personClass = Person.class;
        System.out.println(personClass);
        //方法3  对象.getClass()
        Class<? extends Person> aClass1 = new Person().getClass();
        System.out.println(aClass1);
    }
}
